;;; init-rust.el --- rust config
;;; Commentary:
;;; Code:

;; rustic
(use-package rustic
  :defer t
  :config
  (setq rustic-lsp-client 'eglot)
  (setq rustic-analyzer-command '("~/.cargo/bin/rust-analyzer"))
  )

;; rust-playground 教练场
(use-package rust-playground
  :defer t)

;; rust-auto-use 自动导入
(use-package rust-auto-use
  :defer t)

;; keybinding
(leader-key rustic-mode-map
  "m" '(:ignore t :wk "lang")
  "mx" '(quickrun :wk "run")
  "ma" '(rustic-cargo-add :wk "cargo add")
  "mr" '(rustic-cargo-rm :wk "cargo remove")
  "mu" '(rustic-cargo-upgrade :wk "cargo upgrade")
  "mf" '(rustic-cargo-fmt :wk "cargo fmt")
  "mo" '(rustic-cargo-outdated :wk "cargo outdated")
  "my" '(rustic-cargo-clippy :wk "cargo clippy")
  "mt" '(:ignore t :wk "test")
  "mtt" '(rustic-cargo-current-test :wk "test")
  "mtp" '(rustic-cargo-test :wk "project")
  "mtx" '(rustic-cargo-run :wk "run")
  )

(provide 'init-rust)
;;; init-rust.el ends here
